
const db = require('./db')

let querySQL = (sql,arr)=> {
    let p =  new Promise((resolve,reject)=>{
        db.query(sql,arr,(error,result,fields)=>{
            if(error) reject(error);
            resolve(result);
        })
    });

    return p;
};

module.exports = querySQL